package com.wjjun.base.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.wjjun.base.ui.listener.IPresenter

/**
 * 基础Fragment
 * author : wangjunjun
 * date   : 2022/7/1
 * desc   :
 */
abstract class BaseFragment : Fragment(), IPresenter {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val root = initViews(inflater)
        initContent()
        return root
    }

    abstract fun initViews(inflater: LayoutInflater): View

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        initParams()
        initData()
    }


    override fun initContent() {

    }

    override fun initParams() {
    }

    override fun initData() {
    }

    override fun onClick(view: View) {
    }
}